Use macros to generate help strings and shell code
authorKyle Guinn <elyk03@gmail.com>
Fri, 16 Jun 2017 05:52:59 +0000 (00:52 -0500)
committerKyle Guinn <elyk03@gmail.com>
Fri, 16 Jun 2017 05:52:59 +0000 (00:52 -0500)
configure
configure.ac

index 524533f09e939eaf833fdb4398f6dfa61f681e9e..cffff5db9280cad44fa632fc6bd5ae71792f8d04 100755 (executable)
--- a/configure
+++ b/configure
@@ -2,8 +2,6 @@
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for GPSBabel 1.5.4.
 #
-# Report bugs to <BUG-REPORT-ADDRESS>.
-#
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
@@ -266,11 +264,10 @@ fi
     $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
     $as_echo "$0: be upgraded to zsh 4.3.4 or later."
   else
-    $as_echo "$0: Please tell bug-autoconf@gnu.org and BUG-REPORT-ADDRESS
-$0: about your system, including any error possibly output
-$0: before this message. Then install a modern shell, or
-$0: manually run the script under such a shell if you do
-$0: have one."
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
   fi
   exit 1
 fi
@@ -582,7 +579,7 @@ PACKAGE_NAME='GPSBabel'
 PACKAGE_TARNAME='gpsbabel'
 PACKAGE_VERSION='1.5.4'
 PACKAGE_STRING='GPSBabel 1.5.4'
-PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS'
+PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
 # Factoring default headers for most tests.
@@ -1357,17 +1354,18 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-shapefile=(yes)|no
-  --enable-csv=(yes)|no
-  --enable-most=(yes)|no
-  --enable-filters=(yes)|no
-  --enable-efence=yes|(no)
+  --disable-shapefile
+  --disable-csv
+  --disable-most
+  --disable-filters
+  --enable-efence
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-zlib=(included)|system|no
-  --with-doc=DIR        Path where the documentation will be stored.
+
+  --with-doc=DIR          Path where the documentation will be stored.
 
 Some influential environment variables:
   CC          C compiler command
@@ -1384,7 +1382,7 @@ Some influential environment variables:
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
-Report bugs to <BUG-REPORT-ADDRESS>.
+Report bugs to the package provider.
 _ACEOF
 ac_status=$?
 fi
@@ -1763,10 +1761,6 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## --------------------------------- ##
-## Report this to BUG-REPORT-ADDRESS ##
-## --------------------------------- ##"
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
@@ -4535,93 +4529,94 @@ _ACEOF
 fi
 
 
-if test $GCC = yes; then
- CFLAGS="$CFLAGS -Wall"
- CXXFLAGS="$CXXFLAGS -Wall"
+if test "$GCC" = "yes"; then :
+
+       CFLAGS="$CFLAGS -Wall"
+       CXXFLAGS="$CXXFLAGS -Wall"
+
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support shapefiles" >&5
 $as_echo_n "checking whether to support shapefiles... " >&6; }
 # Check whether --enable-shapefile was given.
 if test "${enable_shapefile+set}" = set; then :
-  enableval=$enable_shapefile;  enable_shapefile="$enableval"
+  enableval=$enable_shapefile;
 else
-  enable_shapefile="yes"
+  enable_shapefile=yes
 fi
 
-    if test "$enable_shapefile" != "no" ; then
+if test "$enable_shapefile" = "yes"; then :
+
 
 $as_echo "#define SHAPELIB_ENABLED 1" >>confdefs.h
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shapefile" >&5
+$as_echo "$enable_shapefile" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support csv formats" >&5
 $as_echo_n "checking whether to support csv formats... " >&6; }
 # Check whether --enable-csv was given.
 if test "${enable_csv+set}" = set; then :
-  enableval=$enable_csv;  enable_csv="$enableval"
+  enableval=$enable_csv;
 else
-  enable_csv="yes"
+  enable_csv=yes
 fi
 
-    if test "$enable_csv" != "no" ; then
+if test "$enable_csv" = "yes"; then :
+
 
 $as_echo "#define CSVFMTS_ENABLED 1" >>confdefs.h
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_csv" >&5
+$as_echo "$enable_csv" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support maximum number of formats" >&5
 $as_echo_n "checking whether to support maximum number of formats... " >&6; }
 # Check whether --enable-most was given.
 if test "${enable_most+set}" = set; then :
-  enableval=$enable_most;  enable_most="$enableval"
+  enableval=$enable_most;
 else
-  enable_most="yes"
+  enable_most=yes
 fi
 
-    if test "$enable_most" != "no" ; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+if test "$enable_most" = "yes"; then :
+
 
 $as_echo "#define MAXIMAL_ENABLED 1" >>confdefs.h
 
        FMTS='$(ALL_FMTS)'
-    else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+
+else
+
        FMTS='$(MINIMAL_FMTS)'
-    fi
 
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_most" >&5
+$as_echo "$enable_most" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support filters" >&5
 $as_echo_n "checking whether to support filters... " >&6; }
 # Check whether --enable-filters was given.
 if test "${enable_filters+set}" = set; then :
-  enableval=$enable_filters;  enable_filters="$enableval"
+  enableval=$enable_filters;
 else
-  enable_filters="yes"
+  enable_filters=yes
 fi
 
-    if test "$enable_filters" != "no" ; then
+if test "$enable_filters" = "yes"; then :
+
 
 $as_echo "#define FILTERS_ENABLED 1" >>confdefs.h
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_filters" >&5
+$as_echo "$enable_filters" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support zlib" >&5
 $as_echo_n "checking whether to support zlib... " >&6; }
@@ -4631,8 +4626,9 @@ if test "${with_zlib+set}" = set; then :
   withval=$with_zlib;
 fi
 
-  case $with_zlib in
-    "system")
+case $with_zlib in #(
+  "system") :
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5
 $as_echo_n "checking for gzopen in -lz... " >&6; }
 if ${ac_cv_lib_z_gzopen+:} false; then :
@@ -4678,31 +4674,41 @@ _ACEOF
 
 fi
 
-       ;;
-    "no")
+ ;; #(
+  "no") :
+
 
 $as_echo "#define ZLIB_INHIBITED 1" >>confdefs.h
 
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-       ;;
-    *)         ZLIB="\$(ZLIB)"
+ ;; #(
+  *) :
+
+       ZLIB="\$(ZLIB)"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: using included version" >&5
-$as_echo "using included version" >&6; };;
-  esac
+$as_echo "using included version" >&6; }
+ ;;
+esac
+
+case "$target" in #(
+  *-*-mingw32*) :
 
-case "$target" in
-    *-*-mingw32*)
        FILEINFO=fileinfo.o
-       if test "$CC" = gcc ; then
+       if test "$CC" = "gcc"; then :
+
                RC=windres
-       else
+
+else
+
                RC=`echo "$CC" | sed -e 's/gcc$/windres/'`
-       fi
-       ;;
-    *)
-       RC=false
-       ;;
+
+fi
+ ;; #(
+  *) :
+
+       RC=false
+ ;;
 esac
 
 
@@ -5013,31 +5019,40 @@ esac
 fi
 
 
-if test "$QMAKE" = no ; then
-  as_fn_error $? "Qt5.2 or higher is required, but was not found" "$LINENO" 5;
+if test "$QMAKE" = "no"; then :
+
+       as_fn_error $? "Qt5.2 or higher is required, but was not found" "$LINENO" 5;
+
 fi
 
 # guess the name of the Qt Core library.
 QT_LIBVER=$($QMAKE -query -query QT_VERSION | sed -e 's/\..*//')
-if test "$QT_LIBVER" -ge 5 ; then
+if test "$QT_LIBVER" -ge 5; then :
+
        QT_LIBS="-L$($QMAKE -query QT_INSTALL_LIBS) -lQt${QT_LIBVER}Core"
+
 else
+
        QT_LIBS="-L$($QMAKE -query QT_INSTALL_LIBS) -lQtCore"
+
 fi
 QT_INC=$($QMAKE -query QT_INSTALL_HEADERS)
 QT_INC_OPT="-I"
 QT_SYSINC_OPT="-isystem"
 
-case "$target" in
-    *-*-cygwin* | *-*-mingw32*)
+case "$target" in #(
+  *-*-cygwin* | *-*-mingw32*) :
 
        GBSER=gbser_win.o
 
-       if test "$with_libusb" = no ; then
+       if test "$with_libusb" = "no"; then :
+
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: USB skipped" >&5
 $as_echo "USB skipped" >&6; }
                OSJEEPS=jeeps/gpsusbstub.o
-       else
+
+else
+
                OSJEEPS=jeeps/gpsusbwin.o
                USB_LIBS="-lsetupapi -lole32 -lws2_32 -luuid"
                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows DDK" >&5
@@ -5074,43 +5089,51 @@ $as_echo "no" >&6; }
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-                LIBS="$old_LIBS"
-       fi
-       ;;
-    *-*-darwin*)
-      GBSER=gbser_posix.o
-      OSJEEPS="jeeps/gpslibusb.o \
-      mac/libusb/darwin.o \
-      mac/libusb/descriptors.o \
-      mac/libusb/error.o \
-      mac/libusb/usb.o "
-      USB_LIBS="-framework  IOKit -framework CoreFoundation"
-      $as_echo "#define HAVE_LIBUSB 1" >>confdefs.h
-
-
-      # On Mac, use frameworks for includes and library files.
-      # Macports uses a non-standard build of Qt with an added
-      # QT_INSTALL_FRAMEWORKS flag, so look for thier custom
-      # version first.  That will fail on 'normal' Qt so fall
-      # back to QT_INSTALL_LIBS.
-      QT_FW_OR_LIBS=$($QMAKE -query QT_INSTALL_FRAMEWORKS)
-      if test $QT_FW_OR_LIBS = "**Unknown**" ; then
-         QT_FW_OR_LIBS=$($QMAKE -query QT_INSTALL_LIBS)
-      fi
-      QT_LIBS="-Wl,-rpath, $QT_FW_OR_LIBS -F$QT_FW_OR_LIBS -framework QtCore"
-      QT_INC="$QT_FW_OR_LIBS"
-      QT_INC_OPT="-F"
-      QT_SYSINC_OPT="-iframework"
-      ;;
-    *-*-freebsd*)
+               LIBS="$old_LIBS"
+
+fi
+ ;; #(
+  *-*-darwin*) :
+
+       GBSER=gbser_posix.o
+       OSJEEPS="jeeps/gpslibusb.o \
+       mac/libusb/darwin.o \
+       mac/libusb/descriptors.o \
+       mac/libusb/error.o \
+       mac/libusb/usb.o "
+       USB_LIBS="-framework  IOKit -framework CoreFoundation"
+       $as_echo "#define HAVE_LIBUSB 1" >>confdefs.h
+
+
+       # On Mac, use frameworks for includes and library files.
+       # Macports uses a non-standard build of Qt with an added
+       # QT_INSTALL_FRAMEWORKS flag, so look for thier custom
+       # version first.  That will fail on 'normal' Qt so fall
+       # back to QT_INSTALL_LIBS.
+       QT_FW_OR_LIBS=$($QMAKE -query QT_INSTALL_FRAMEWORKS)
+       if test "$QT_FW_OR_LIBS" = "**Unknown**"; then :
+
+               QT_FW_OR_LIBS=$($QMAKE -query QT_INSTALL_LIBS)
+
+fi
+       QT_LIBS="-Wl,-rpath, $QT_FW_OR_LIBS -F$QT_FW_OR_LIBS -framework QtCore"
+       QT_INC="$QT_FW_OR_LIBS"
+       QT_INC_OPT="-F"
+       QT_SYSINC_OPT="-iframework"
+ ;; #(
+  *-*-freebsd*) :
+
        GBSER=gbser_posix.o
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb" >&5
 $as_echo_n "checking for libusb... " >&6; }
-       if test "$with_libusb" = no ; then
+       if test "$with_libusb" = "no"; then :
+
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: check not done" >&5
 $as_echo "check not done" >&6; }
                OSJEEPS=jeeps/gpsusbstub.o
-       else
+
+else
+
                OLDFLAGS=$LDFLAGS
                OCFLAGS=$CFLAGS
                LDFLAGS="$LDFLAGS -lusb"
@@ -5158,23 +5181,28 @@ $as_echo "#define HAVE_LIBUSB 1" >>confdefs.h
 
                        USB_CFLAGS=""
                        USB_LIBS="-lusb"
-#                      ,[AC_MSG_ERROR([libusb is needed])]
+                       #,[AC_MSG_ERROR([libusb is needed])]
 
 fi
 
                OSJEEPS=jeeps/gpslibusb.o
                CFLAGS="$OCFLAGS"
-       fi
-       ;;
-    *)
+
+fi
+ ;; #(
+  *) :
+
        GBSER=gbser_posix.o
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb" >&5
 $as_echo_n "checking for libusb... " >&6; }
-       if test "$with_libusb" = no ; then
+       if test "$with_libusb" = "no"; then :
+
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: check not done" >&5
 $as_echo "check not done" >&6; }
                OSJEEPS=jeeps/gpsusbstub.o
-       else
+
+else
+
                # Extract the first word of "libusb-config", so it can be a program name with args.
 set dummy libusb-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5213,13 +5241,14 @@ $as_echo "no" >&6; }
 fi
 
 
-           if test "$LIBUSBCONFIG" = true; then
-               OLDFLAGS=$LDFLAGS
-               OCFLAGS=$CFLAGS
-               LDFLAGS="$LDFLAGS `libusb-config --libs`"
-               CFLAGS="$OCFLAGS `libusb-config --cflags`"
+               if test "$LIBUSBCONFIG" = "true"; then :
 
-               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_interrupt_read in -lusb" >&5
+                       OLDFLAGS=$LDFLAGS
+                       OCFLAGS=$CFLAGS
+                       LDFLAGS="$LDFLAGS `libusb-config --libs`"
+                       CFLAGS="$OCFLAGS `libusb-config --cflags`"
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_interrupt_read in -lusb" >&5
 $as_echo_n "checking for usb_interrupt_read in -lusb... " >&6; }
 if ${ac_cv_lib_usb_usb_interrupt_read+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -5259,20 +5288,24 @@ if test "x$ac_cv_lib_usb_usb_interrupt_read" = xyes; then :
 
 $as_echo "#define HAVE_LIBUSB 1" >>confdefs.h
 
-                       USB_CFLAGS="`libusb-config --cflags`"
-                       USB_LIBS="`libusb-config --libs`"
-#                      ,[AC_MSG_ERROR([libusb >= 0.1.8 is needed])]
+                               USB_CFLAGS="`libusb-config --cflags`"
+                               USB_LIBS="`libusb-config --libs`"
+                               #,[AC_MSG_ERROR([libusb >= 0.1.8 is needed])]
 
 fi
 
-               OSJEEPS=jeeps/gpslibusb.o
-               CFLAGS="$OCFLAGS"
-       #       LIBS="$LIBS `libusb-config --libs`"
-           else
-               OSJEEPS=jeeps/gpsusbstub.o
-           fi
-       fi
-       ;;
+                       OSJEEPS=jeeps/gpslibusb.o
+                       CFLAGS="$OCFLAGS"
+                       #LIBS="$LIBS `libusb-config --libs`"
+
+else
+
+                       OSJEEPS=jeeps/gpsusbstub.o
+
+fi
+
+fi
+ ;;
 esac
 
 
@@ -5281,8 +5314,9 @@ esac
 
 
 
-case "$target" in
-       *-linux-*)
+case "$target" in #(
+  *-linux-*) :
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux HID interface" >&5
 $as_echo_n "checking for Linux HID interface... " >&6; }
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5314,13 +5348,17 @@ else
 $as_echo "no" >&6; }
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-       ;;
+ ;; #(
+  *) :
+     ;;
 esac
 
-case "$target" in
-       *-*-darwin*)
-       ;;
-       *)
+case "$target" in #(
+  *-*-darwin*) :
+
+ ;; #(
+  *) :
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for reduce relocations" >&5
 $as_echo_n "checking for reduce relocations... " >&6; }
        OCPPFLAGS="$CPPFLAGS"
@@ -5360,7 +5398,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
        CPPFLAGS="$OCPPFLAGS"
      ;;
+ ;;
 esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for random stuff to make you feel better" >&5
@@ -5372,11 +5410,13 @@ $as_echo "failed" >&6; }
 $as_echo_n "checking for efence... " >&6; }
 # Check whether --enable-efence was given.
 if test "${enable_efence+set}" = set; then :
-  enableval=$enable_efence;  if test "$enable_efence" != "no" ; then
-       EFENCE_LIB=-lefence
-       GPSBABEL_DEBUG=gpsbabel-debug
-       INSTALL_DEBUG=install-debug
-    fi
+  enableval=$enable_efence; if test "$enable_efence" != "no"; then :
+
+               EFENCE_LIB=-lefence
+               GPSBABEL_DEBUG=gpsbabel-debug
+               INSTALL_DEBUG=install-debug
+
+fi
 fi
 
 
@@ -5396,6 +5436,8 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCDIR" >&5
+$as_echo "$DOCDIR" >&6; }
 
 # Checks for header files.
 # AC_HEADER_STDC
@@ -6022,7 +6064,7 @@ $config_files
 Configuration headers:
 $config_headers
 
-Report bugs to <BUG-REPORT-ADDRESS>."
+Report bugs to the package provider."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
@@ -6752,4 +6794,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
-
index ee4e9168eed5ed4415d697d9f80bc71c2214eeab..25e471d9b3c6aae3bed316c302588da238aec644 100644 (file)
@@ -1,10 +1,10 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.59)
+AC_PREREQ([2.59])
 
 #PACKAGE_RELEASE=
-AC_INIT(GPSBabel, 1.5.4, BUG-REPORT-ADDRESS)
+AC_INIT([GPSBabel], [1.5.4])
 DOCVERSION=1.5.4
 
 # YYYYMMDD, please, if beta, i.e. "-beta20060413"
@@ -52,85 +52,88 @@ AC_C_BIGENDIAN
 # Checks for libraries.
 AC_CHECK_LIB([m], [cos])
 
-if test $GCC = yes; then
- CFLAGS="$CFLAGS -Wall"
- CXXFLAGS="$CXXFLAGS -Wall"
-fi
-
-AC_MSG_CHECKING(whether to support shapefiles)
-AC_ARG_ENABLE(shapefile,
-  [  --enable-shapefile=[(yes)|no]],
-  [ enable_shapefile="$enableval"],[enable_shapefile="yes"])
-    if test "$enable_shapefile" != "no" ; then
-        AC_DEFINE(SHAPELIB_ENABLED, 1, [1 to enable shapefile support])
-       AC_MSG_RESULT(yes)
-    else
-       AC_MSG_RESULT(no)
-    fi
-
-AC_MSG_CHECKING(whether to support csv formats)
-AC_ARG_ENABLE(csv,
-  [  --enable-csv=[(yes)|no]],
-  [ enable_csv="$enableval"],[enable_csv="yes"])
-    if test "$enable_csv" != "no" ; then
-        AC_DEFINE(CSVFMTS_ENABLED, 1, [1 to enable the CSV formats support])
-       AC_MSG_RESULT(yes)
-    else
-       AC_MSG_RESULT(no)
-    fi
-
-AC_MSG_CHECKING(whether to support maximum number of formats)
-AC_ARG_ENABLE(most,
-  [  --enable-most=[(yes)|no]],
-  [ enable_most="$enableval"],[enable_most="yes"])
-    if test "$enable_most" != "no" ; then
-       AC_MSG_RESULT(yes)
-        AC_DEFINE(MAXIMAL_ENABLED, 1, [1 to enable as many formats as possible])
+AS_IF([test "$GCC" = "yes"], [
+       CFLAGS="$CFLAGS -Wall"
+       CXXFLAGS="$CXXFLAGS -Wall"
+])
+
+AC_MSG_CHECKING([whether to support shapefiles])
+AC_ARG_ENABLE([shapefile],
+       [AS_HELP_STRING(
+               [--disable-shapefile],
+               [])],
+       [],
+       [AS_VAR_SET([enable_shapefile], [yes])])
+AS_IF([test "$enable_shapefile" = "yes"], [
+       AC_DEFINE(SHAPELIB_ENABLED, 1, [1 to enable shapefile support])
+])
+AC_MSG_RESULT([$enable_shapefile])
+
+AC_MSG_CHECKING([whether to support csv formats])
+AC_ARG_ENABLE([csv],
+       [AS_HELP_STRING(
+               [--disable-csv],
+               [])],
+       [],
+       [AS_VAR_SET([enable_csv], [yes])])
+AS_IF([test "$enable_csv" = "yes"], [
+       AC_DEFINE(CSVFMTS_ENABLED, 1, [1 to enable the CSV formats support])
+])
+AC_MSG_RESULT([$enable_csv])
+
+AC_MSG_CHECKING([whether to support maximum number of formats])
+AC_ARG_ENABLE([most],
+       [AS_HELP_STRING(
+               [--disable-most],
+               [])],
+       [],
+       [AS_VAR_SET([enable_most], [yes])])
+AS_IF([test "$enable_most" = "yes"], [
+       AC_DEFINE(MAXIMAL_ENABLED, 1, [1 to enable as many formats as possible])
        FMTS='$(ALL_FMTS)'
-    else
-       AC_MSG_RESULT(no)
+], [
        FMTS='$(MINIMAL_FMTS)'
-    fi
-  AC_SUBST(FMTS)
-
-AC_MSG_CHECKING(whether to support filters)
-AC_ARG_ENABLE(filters,
-  [  --enable-filters=[(yes)|no]],
-  [ enable_filters="$enableval"],[enable_filters="yes"])
-    if test "$enable_filters" != "no" ; then
+])
+AC_SUBST(FMTS)
+AC_MSG_RESULT([$enable_most])
+
+AC_MSG_CHECKING([whether to support filters])
+AC_ARG_ENABLE([filters],
+       [AS_HELP_STRING(
+               [--disable-filters],
+               [])],
+       [],
+       [AS_VAR_SET([enable_filters], [yes])])
+AS_IF([test "$enable_filters" = "yes"], [
        AC_DEFINE(FILTERS_ENABLED, 1, [1 to enable all the filters.])
-       AC_MSG_RESULT(yes)
-    else
-       AC_MSG_RESULT(no)
-    fi
-
-AC_MSG_CHECKING(whether to support zlib)
-AC_ARG_WITH(zlib, [  --with-zlib=[(included)|system|no]])
-  case $with_zlib in 
-    "system") 
+])
+AC_MSG_RESULT([$enable_filters])
+
+AC_MSG_CHECKING([whether to support zlib])
+AC_ARG_WITH([zlib],
+       [AS_HELP_STRING(
+               [--with-zlib=(included)|system|no],
+               [])])
+AS_CASE([$with_zlib], ["system"], [
        AC_CHECK_LIB([z], [gzopen])
-       ;;
-    "no") 
-        AC_DEFINE(ZLIB_INHIBITED, 1, [1 to inhibit our use of zlib.])
-       AC_MSG_RESULT(no) 
-       ;;
-    *)         ZLIB="\$(ZLIB)" 
-       AC_MSG_RESULT(using included version);;
-  esac
-
-case "$target" in
-    *-*-mingw32*)
+], ["no"], [
+       AC_DEFINE(ZLIB_INHIBITED, 1, [1 to inhibit our use of zlib.])
+       AC_MSG_RESULT([no])
+], [
+       ZLIB="\$(ZLIB)"
+       AC_MSG_RESULT([using included version])
+])
+
+AS_CASE(["$target"], [*-*-mingw32*], [
        FILEINFO=fileinfo.o
-       if test "$CC" = gcc ; then
+       AS_IF([test "$CC" = "gcc"], [
                RC=windres
-       else
+       ], [
                RC=`echo "$CC" | sed -e 's/gcc$/windres/'`
-       fi
-       ;;
-    *)
-       RC=false
-       ;;
-esac
+       ])
+], [
+       RC=false
+])
 AC_SUBST(FILEINFO)
 AC_SUBST(RC)
 # On RHEL/OEL/SL/CENTOS/FEDORA qmake is from Qt3, and qmake-qt4 is from Qt4.
@@ -143,30 +146,28 @@ AC_CHECK_TOOLS(QMAKE, [qmake-qt5 qmake], "no")
 AC_CHECK_TOOLS(LUPDATE, [lupdate-qt5 lupdate])
 AC_CHECK_TOOLS(LRELEASE, [lrelease-qt5 lrelease])
 
-if test "$QMAKE" = no ; then
-  AC_MSG_ERROR([Qt5.2 or higher is required, but was not found]);
-fi
+AS_IF([test "$QMAKE" = "no"], [
+       AC_MSG_ERROR([Qt5.2 or higher is required, but was not found]);
+])
 
 # guess the name of the Qt Core library.
 QT_LIBVER=$($QMAKE -query -query QT_VERSION | sed -e 's/\..*//')
-if test "$QT_LIBVER" -ge 5 ; then
+AS_IF([test "$QT_LIBVER" -ge 5], [
        QT_LIBS="-L$($QMAKE -query QT_INSTALL_LIBS) -lQt${QT_LIBVER}Core"
-else
+], [
        QT_LIBS="-L$($QMAKE -query QT_INSTALL_LIBS) -lQtCore"
-fi
+])
 QT_INC=$($QMAKE -query QT_INSTALL_HEADERS)
 QT_INC_OPT="-I"
 QT_SYSINC_OPT="-isystem"
 
-case "$target" in
-    *-*-cygwin* | *-*-mingw32*)
-
+AS_CASE(["$target"], [*-*-cygwin* | *-*-mingw32*], [
        GBSER=gbser_win.o
 
-       if test "$with_libusb" = no ; then
+       AS_IF([test "$with_libusb" = "no"], [
                AC_MSG_RESULT(USB skipped)
                OSJEEPS=jeeps/gpsusbstub.o
-       else
+       ], [
                OSJEEPS=jeeps/gpsusbwin.o
                USB_LIBS="-lsetupapi -lole32 -lws2_32 -luuid"
                AC_MSG_CHECKING(for Windows DDK)
@@ -183,41 +184,39 @@ case "$target" in
                        [AC_DEFINE(HAVE_WDK, 1, [Defined if you have Windows DDK])]
                        [USB_LIBS=${USB_LIBS}" -lhid"],
                        [AC_MSG_RESULT(no)]
-                ) 
-                LIBS="$old_LIBS"
-       fi
-       ;;
-    *-*-darwin*)
-      GBSER=gbser_posix.o
-      OSJEEPS="jeeps/gpslibusb.o \
-      mac/libusb/darwin.o \
-      mac/libusb/descriptors.o \
-      mac/libusb/error.o \
-      mac/libusb/usb.o "
-      USB_LIBS="-framework  IOKit -framework CoreFoundation"
-      AC_DEFINE(HAVE_LIBUSB, 1)
-      # On Mac, use frameworks for includes and library files.
-      # Macports uses a non-standard build of Qt with an added 
-      # QT_INSTALL_FRAMEWORKS flag, so look for thier custom
-      # version first.  That will fail on 'normal' Qt so fall 
-      # back to QT_INSTALL_LIBS.
-      QT_FW_OR_LIBS=$($QMAKE -query QT_INSTALL_FRAMEWORKS)
-      if test $QT_FW_OR_LIBS = "**Unknown**" ; then
-         QT_FW_OR_LIBS=$($QMAKE -query QT_INSTALL_LIBS)
-      fi
-      QT_LIBS="-Wl,-rpath, $QT_FW_OR_LIBS -F$QT_FW_OR_LIBS -framework QtCore"
-      QT_INC="$QT_FW_OR_LIBS"
-      QT_INC_OPT="-F"
-      QT_SYSINC_OPT="-iframework"
-      ;;
-    *-*-freebsd*)
+               )
+               LIBS="$old_LIBS"
+       ])
+], [*-*-darwin*], [
+       GBSER=gbser_posix.o
+       OSJEEPS="jeeps/gpslibusb.o \
+       mac/libusb/darwin.o \
+       mac/libusb/descriptors.o \
+       mac/libusb/error.o \
+       mac/libusb/usb.o "
+       USB_LIBS="-framework  IOKit -framework CoreFoundation"
+       AC_DEFINE(HAVE_LIBUSB, 1)
+
+       # On Mac, use frameworks for includes and library files.
+       # Macports uses a non-standard build of Qt with an added
+       # QT_INSTALL_FRAMEWORKS flag, so look for thier custom
+       # version first.  That will fail on 'normal' Qt so fall
+       # back to QT_INSTALL_LIBS.
+       QT_FW_OR_LIBS=$($QMAKE -query QT_INSTALL_FRAMEWORKS)
+       AS_IF([test "$QT_FW_OR_LIBS" = "**Unknown**"], [
+               QT_FW_OR_LIBS=$($QMAKE -query QT_INSTALL_LIBS)
+       ])
+       QT_LIBS="-Wl,-rpath, $QT_FW_OR_LIBS -F$QT_FW_OR_LIBS -framework QtCore"
+       QT_INC="$QT_FW_OR_LIBS"
+       QT_INC_OPT="-F"
+       QT_SYSINC_OPT="-iframework"
+], [*-*-freebsd*], [
        GBSER=gbser_posix.o
        AC_MSG_CHECKING(for libusb)
-       if test "$with_libusb" = no ; then
+       AS_IF([test "$with_libusb" = "no"], [
                AC_MSG_RESULT(check not done)
                OSJEEPS=jeeps/gpsusbstub.o
-       else
+       ], [
                OLDFLAGS=$LDFLAGS
                OCFLAGS=$CFLAGS
                LDFLAGS="$LDFLAGS -lusb"
@@ -227,41 +226,39 @@ case "$target" in
                        AC_DEFINE(HAVE_LIBUSB, 1, [Defined if you have libusb])
                        [USB_CFLAGS=""]
                        [USB_LIBS="-lusb"]
-#                      ,[AC_MSG_ERROR([libusb is needed])]
-                       )
+                       #,[AC_MSG_ERROR([libusb is needed])]
+               )
                OSJEEPS=jeeps/gpslibusb.o
                CFLAGS="$OCFLAGS"
-       fi
-       ;;
-    *)
+       ])
+], [
        GBSER=gbser_posix.o
        AC_MSG_CHECKING(for libusb)
-       if test "$with_libusb" = no ; then
+       AS_IF([test "$with_libusb" = "no"], [
                AC_MSG_RESULT(check not done)
                OSJEEPS=jeeps/gpsusbstub.o
-       else
+       ], [
                AC_CHECK_PROG(LIBUSBCONFIG, libusb-config, true, false)
-           if test "$LIBUSBCONFIG" = true; then
-               OLDFLAGS=$LDFLAGS
-               OCFLAGS=$CFLAGS
-               LDFLAGS="$LDFLAGS `libusb-config --libs`"
-               CFLAGS="$OCFLAGS `libusb-config --cflags`"
-
-               AC_CHECK_LIB([usb], [usb_interrupt_read],
-                       AC_DEFINE(HAVE_LIBUSB, 1, [Defined if you have libusb])
-                       [USB_CFLAGS="`libusb-config --cflags`"]
-                       [USB_LIBS="`libusb-config --libs`"]
-#                      ,[AC_MSG_ERROR([libusb >= 0.1.8 is needed])]
+               AS_IF([test "$LIBUSBCONFIG" = "true"], [
+                       OLDFLAGS=$LDFLAGS
+                       OCFLAGS=$CFLAGS
+                       LDFLAGS="$LDFLAGS `libusb-config --libs`"
+                       CFLAGS="$OCFLAGS `libusb-config --cflags`"
+
+                       AC_CHECK_LIB([usb], [usb_interrupt_read],
+                               AC_DEFINE(HAVE_LIBUSB, 1, [Defined if you have libusb])
+                               [USB_CFLAGS="`libusb-config --cflags`"]
+                               [USB_LIBS="`libusb-config --libs`"]
+                               #,[AC_MSG_ERROR([libusb >= 0.1.8 is needed])]
                        )
-               OSJEEPS=jeeps/gpslibusb.o
-               CFLAGS="$OCFLAGS"
-       #       LIBS="$LIBS `libusb-config --libs`"
-           else
-               OSJEEPS=jeeps/gpsusbstub.o
-           fi
-       fi
-       ;;
-esac
+                       OSJEEPS=jeeps/gpslibusb.o
+                       CFLAGS="$OCFLAGS"
+                       #LIBS="$LIBS `libusb-config --libs`"
+               ], [
+                       OSJEEPS=jeeps/gpsusbstub.o
+               ])
+       ])
+])
 
 AC_SUBST(USB_LIBS)
 AC_SUBST(USB_CFLAGS)
@@ -270,8 +267,7 @@ AC_SUBST(GBSER)
 AC_SUBST(ZLIB)
 
 dnl Linux HID support
-case "$target" in
-       *-linux-*)
+AS_CASE(["$target"], [*-linux-*], [
        AC_MSG_CHECKING(for Linux HID interface)
        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
                #include <sys/ioctl.h>
@@ -291,13 +287,10 @@ case "$target" in
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_LINUX_HID, 1, [Defined if you have Linux HID]),
                AC_MSG_RESULT(no))
-       ;;
-esac
+])
 
-case "$target" in
-       *-*-darwin*)
-       ;;
-       *)
+AS_CASE(["$target"], [*-*-darwin*], [
+], [
        AC_MSG_CHECKING(for reduce relocations)
        OCPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS -I$QT_INC"
@@ -319,29 +312,35 @@ case "$target" in
                        )]
                )
        CPPFLAGS="$OCPPFLAGS"
-       ;;
-esac
-
-AC_MSG_CHECKING(for random stuff to make you feel better)
-AC_MSG_RESULT(failed)
-
-AC_MSG_CHECKING(for efence)
-AC_ARG_ENABLE(efence,
-  [  --enable-efence=[yes|(no)]],
-  [ if test "$enable_efence" != "no" ; then
-       EFENCE_LIB=-lefence
-       GPSBABEL_DEBUG=gpsbabel-debug
-       INSTALL_DEBUG=install-debug
-    fi])
+])
+
+AC_MSG_CHECKING([for random stuff to make you feel better])
+AC_MSG_RESULT([failed])
+
+AC_MSG_CHECKING([for efence])
+AC_ARG_ENABLE([efence],
+       [AS_HELP_STRING(
+               [--enable-efence],
+               [])],
+       [AS_IF([test "$enable_efence" != "no"], [
+               EFENCE_LIB=-lefence
+               GPSBABEL_DEBUG=gpsbabel-debug
+               INSTALL_DEBUG=install-debug
+       ])])
 AC_SUBST(EFENCE_LIB)
 AC_SUBST(GPSBABEL_DEBUG)
 AC_SUBST(INSTALL_DEBUG)
-AC_MSG_RESULT($EFENCE_LIB)
-
-AC_MSG_CHECKING(for docdir)
-AC_ARG_WITH(doc,[  --with-doc=DIR        Path where the documentation will be stored.],
-             DOCDIR="$withval", DOCDIR="../babelweb/")
+AC_MSG_RESULT([$EFENCE_LIB])
+
+AC_MSG_CHECKING([for docdir])
+AC_ARG_WITH([doc],
+       [AS_HELP_STRING(
+               [--with-doc=DIR],
+               [Path where the documentation will be stored.])],
+       [DOCDIR="$withval"],
+       [DOCDIR="../babelweb/"])
 AC_SUBST(DOCDIR)
+AC_MSG_RESULT([$DOCDIR])
 
 # Checks for header files.
 # AC_HEADER_STDC
@@ -382,4 +381,3 @@ AC_SUBST(QT_LIBS)
 AC_CONFIG_FILES([Makefile gbversion.h gui/setup.iss xmldoc/makedoc tools/mkcapabilities win32/gpsbabel.rc jeeps/Makefile shapelib/Makefile zlib/empty])
 AC_CONFIG_FILES([gui/makelinuxdist.sh], [chmod +x gui/makelinuxdist.sh])
 AC_OUTPUT
-